import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout.vue'
import Index from '@/views/MyIndex/index.vue'
const City = () => import('@/views/city.vue')
const House = () => import('@/views/MyIndex/house.vue')
const Map = () => import('@/views/map.vue')
const Zixun = () => import('@/views/MyIndex/zixun.vue')
const Mymy = () => import('@/views/MyIndex/My.vue')
const Login = () => import('@/views/login.vue')
const Registe = () => import('@/views/registe.vue')
const Housexq = () => import('@/views/housexq.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/index',
    children: [
      { path: 'index', component: Index },
      { path: 'house', component: House },
      { path: 'zixun', component: Zixun },
      { path: 'mymy', component: Mymy }
    ]
  },
  { path: '/city', component: City },
  { path: '/map', component: Map },
  { path: '/login', component: Login },
  { path: '/registe', component: Registe },
  { path: '/housexq/:id', component: Housexq }
]

const router = new VueRouter({
  routes
})

export default router
